var config = iClass.config;
iClass.method("News", {
	setInfo: function(info) {
		info.title = String(info.title || "")
		info.content = String(info.content || "");

		/*
		 * 新闻标题
		 */
		if (!info.title) {
			Throw("新闻标题不可为空");
		}
		if (info.title.length > config.newsTitleMaxLength) {
			Throw("新闻标题长度超过限制（" + config.newsTitleMaxLength + "字以内）");
		}
		this.title = info.title;

		/*
		 * 新闻内容
		 */
		if (!info.content) {
			Throw("新闻内容不可为空");
		}
		this.content = info.content;

		this.last_update_time = +new Date;
		this.save();
	}
});